/**
 * <strong>Title : EquipmentAttachServiceImpl.java<br>
 * </strong> <strong>Package : cn.b.sky.mes.em.service.impl<br>
 * </strong> <strong>Description : </strong>@类注释说明写在此处@<br>
 * <strong>Create on : 2016年1月8日 上午11:19:09<br>
 * </strong>
 * <p>
 * @author dapeng.li<br>
 * @version <strong>v1.0.0</strong><br>
 * <br>
 *          <strong>修改历史:</strong><br>
 *          修改人 | 修改日期 | 修改描述<br>
 *          -------------------------------------------<br>
 * <br>
 * <br>
 */
package cn.b.sky.mes.em.service.impl;

import java.util.List;

import javax.annotation.Resource;

import cn.b.sky.mes.em.model.EquipmentAttach;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import cn.b.sky.mes.em.dao.EquipmentAttachDao;
import cn.b.sky.mes.em.service.EquipmentAttachService;

/**
 * <strong>Title : EquipmentAttachServiceImpl.java<br></strong>
 * <strong>Package : cn.b.sky.mes.em.service.impl<br></strong>
 * <strong>Description : </strong>设备附件接口实现<br> 
 * <strong>Create on : 2016年1月8日 上午11:19:09<br></strong>
 * <p>
 * @author dapeng.li<br>
 * @version <strong>v1.0.0</strong><br>
 * <br>
 * <strong>修改历史:</strong><br>
 * 修改人 | 修改日期 | 修改描述<br>
 * -------------------------------------------<br>
 * <br>
 * <br>
 */
@Service("equipmentAttachService")
public class EquipmentAttachServiceImpl implements EquipmentAttachService {

  @Resource
  EquipmentAttachDao equipmentAttachDao;

  @Override
  public EquipmentAttach getEquipmentAttachmentById(Long id) {
    if (id != null) {
      return equipmentAttachDao.getEquipmentAttachmentById(id);
    }
    return null;
  }

  @Override
  public List<EquipmentAttach> selectEquipmentAttach(String equipmentCode, String siteCode) {
    if (StringUtils.isBlank(equipmentCode) || StringUtils.isBlank(siteCode)) {
      return null;
    }
    return equipmentAttachDao.selectEquipmentAttach(equipmentCode, siteCode);
  }

  @Override
  public void insertEquipmentAttach(EquipmentAttach attach) {
    equipmentAttachDao.insertEquipmentAttach(attach);
  }

  @Override
  public void deleteEquipmentAttach(String equipmentCode, String siteCode) {
    if (StringUtils.isBlank(equipmentCode) || StringUtils.isBlank(siteCode)) {
      equipmentAttachDao.deleteEquipmentAttach(equipmentCode, siteCode);
    }
  }

}
